﻿<local:BaseWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.Dashboard.OverclockDiscreteGPUSettingsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:LenovoLegionToolkit.WPF.Windows"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Title="{x:Static resources:Resource.OverclockDiscreteGPUSettingsWindow_Title}"
    MinWidth="500"
    MinHeight="275"
    MaxWidth="500"
    MaxHeight="275"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}"
    ResizeMode="NoResize"
    ShowInTaskbar="False"
    WindowStartupLocation="CenterOwner">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <wpfui:TitleBar
            Grid.Row="0"
            CanMaximize="false"
            ShowMaximize="false"
            ShowMinimize="false"
            UseSnapLayout="false" />

        <Grid
            Grid.Row="0"
            Height="24"
            Margin="12,8,12,8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                Grid.Column="0"
                VerticalAlignment="Center"
                FontSize="12"
                IsHitTestVisible="False"
                Text="{x:Static resources:Resource.OverclockDiscreteGPUSettingsWindow_Title}" />
        </Grid>

        <Grid Grid.Row="1" Margin="16,16,16,16">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="75" />
                </Grid.ColumnDefinitions>

                <TextBlock
                    Grid.Row="0"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    Text="{x:Static resources:Resource.OverclockDiscreteGPUSettingsWindow_CoreFrequencyOffset_Title}" />
                <Slider
                    x:Name="_coreSlider"
                    Grid.Row="1"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Margin="0,16,8,0"
                    IsSnapToTickEnabled="True"
                    Minimum="0"
                    TickFrequency="1"
                    ValueChanged="CoreSlider_OnValueChanged" />
                <Label
                    x:Name="_coreLabel"
                    Grid.Row="1"
                    Grid.Column="2"
                    Margin="0,16,0,0"
                    HorizontalContentAlignment="Right" />

                <TextBlock
                    Grid.Row="2"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    Margin="0,16,0,0"
                    Text="{x:Static resources:Resource.OverclockDiscreteGPUSettingsWindow_MemoryFrequencyOffset_Title}" />
                <Slider
                    x:Name="_memorySlider"
                    Grid.Row="3"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Margin="0,16,8,0"
                    IsSnapToTickEnabled="True"
                    Minimum="0"
                    TickFrequency="1"
                    ValueChanged="MemorySlider_OnValueChanged" />
                <Label
                    x:Name="_memoryLabel"
                    Grid.Row="3"
                    Grid.Column="2"
                    Margin="0,16,0,0"
                    HorizontalContentAlignment="Right" />
            </Grid>

            <Grid
                x:Name="_applyCloseGrid"
                Grid.Row="1"
                Margin="0,8,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <wpfui:Button
                    Grid.Column="1"
                    MinWidth="100"
                    Click="ApplyButton_Click"
                    Content="{x:Static resources:Resource.Apply}" />

                <wpfui:Button
                    Grid.Column="2"
                    MinWidth="100"
                    Margin="8,0,0,0"
                    Appearance="Primary"
                    Click="ApplyAndCloseButton_Click"
                    Content="{x:Static resources:Resource.ApplyAndClose}" />
            </Grid>

            <Grid
                x:Name="_saveGrid"
                Grid.Row="1"
                Margin="0,8,0,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <wpfui:Button
                    Grid.Column="1"
                    MinWidth="100"
                    Appearance="Primary"
                    Click="SaveButton_Click"
                    Content="{x:Static resources:Resource.Save}" />
            </Grid>
        </Grid>

    </Grid>
</local:BaseWindow>
